package com.iflytek.universitymanagement.controller;


import com.iflytek.universitymanagement.domain.StudentCounselingStats;
import com.iflytek.universitymanagement.service.StudentCounselingStatsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/studentCounselingStats")
public class StudentCounselingStatsController {
    @Autowired
    StudentCounselingStatsService studentCounselingStatsService;

    @GetMapping("/getAllStudentCounselingStats")
    public List<StudentCounselingStats> getAllStudentCounselingStats() {
       return studentCounselingStatsService.getAllStudentCounselingStatsWithStudentName();
    }

    @DeleteMapping("/delete/{id}")
    public ResponseEntity<?> deleteCounselingStat(@PathVariable Integer id) {
        studentCounselingStatsService.removeById(id);
        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
    }



}

